Assignment
individual assignment:
write an application that interfaces with an input &/or output device
that you made
group assignment:
compare as many tool options as possible
Individual assignment
Processing
Below are some references
- What is Processing ? Wikipedia
- Processing Website
- Processing Tutorial
- Connecting-arduino-to-processing Sparkfun
- Processing References
- Processing Tutorial Daniel Shiffmen
Sketch 1
Based on the Sparkfun tutorial I have tested the connection between Processing and Arduino
![all](images/WEEK16/sparfun-test.jpg)
When I press the mouse button inside the processing box ,the led on my board will turn on and when I press again it will turn off
Sketch 2
Now I will test a simple serial connection with the ldr value of my previous Board B1
![all](images/WEEK16/simple-read-ldr.jpg)
![my board ldr](images/WEEK16/my-board-ldr.jpg)
Code explanation:
In Arduino code the ldr value is checked , if the value is higher than 500 than it will send 1 on the serial if not it will send 0
In Processing software the code reads the value received on the serial and if it is equal to 0 than it will draw a rectangle with black color "fill (0)" if else it will change the color to grey "fill (204)"
After that I have made some adjustments in the code and changed the size of the display from 200x200 to 400x400 and change the rectangle to circle.
![all](images/WEEK16/simple-read-ldr1.jpg)
After that I have changed the background color and added a text showing the received values
![all](images/WEEK16/simple-read-ldr2.jpg)
![all](images/WEEK16/simple-read-ldr2-2.jpg)
Sketch 3
Now I will test another simple serial connection with a Potentiometer connected to my Board B1
![pot](images/WEEK16/simple-read-pot.jpg)
![my board pot](images/WEEK16/my-board-pot.jpg)
Sketch 4
Now I will control the Led on Pin13 with the Potentiometer connected to my Board B1
![pot](images/WEEK16/simple-read-pot-led.jpg)
The background color will change with the potentiometer value and the led is controlled by the mouse buttons: left click will turn on the led and the right-click will turn off the led.
Group Assignment:
Compare as many tool options as possible
Check Berytech page for the Group Assignment
As from my side I tried the MIT APP INVENTOR
I will connect through bluetooth to turn on and off the led light and the fan of my final project
![app1](images/WEEK16/mit-app1.jpg)
To turn on the led it will send 1 via the appliction and to turn off the led it will send 0
To turn on the fan it will send A via the appliction and to turn off the fan it will send B
![app2](images/WEEK16/mit-app2.jpg)
After that I will press on build to generate the application.
![app3](images/WEEK16/mit-app3.jpg)
![app4](images/WEEK16/mit-app4.jpg)
I will receive a QRCODE to read via my phone to install the application.
![app5](images/WEEK16/mit-app5.jpg)
And this is the code used for testing
![code](images/WEEK16/mit-app-code.jpg)
Files
Click Here to download the Processing Sketch 2
Click Here to download the Arduino Sketch 2
Click Here to download the Processing Sketch 3
Click Here to download the Arduino Sketch 3
Click Here to download the Processing Sketch 4
Click Here to download the Arduino Sketch 4
Click Here to download the mit-app-inventor Bluetooth Code
Click Here to download the Phone App